/*
 * ToggleToolButtonDelegate.h  0.4.0 / Dec 04, 2010
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
#ifndef TOGGLETOOLBUTTONDELEGATE_H
#define TOGGLETOOLBUTTONDELEGATE_H

#include "Cute4jSwing.h"

#include "ToggleButtonDelegate.h"

// ToggleToolButtonDelegate Class. ---------------------------------------------

/*!
 * \brief ToggleToolButton Delegate.
 *
 * \author Slobodan Vrkacevic
 * \version 0.4.0
 */
class CUTE4J_EXPORT ToggleToolButtonDelegate : public ToggleButtonDelegate
{
  Q_OBJECT
protected:
  ToggleToolButtonDelegate(JNIEnv *env, jobject obj);
public slots: // native calls
  void setMenu(JNIEnv *env, jlong menuDelegate);
  void setPopupMode(JNIEnv *env, jint popupMode);
  void setToolButtonStyle(JNIEnv *env, jint toolButtonStyle);
public: // native calls
  static jlong newInstance(JNIEnv *env, jobject obj);
public:
  inline QToolButton *qToggleToolButton() const;
};

// ToggleToolButtonDelegate :: Public Inline Member Function. ------------------

/*!
 * \brief Returns QToolButton adaptee.
 *
 * \return QToolButton adaptee
 */
inline QToolButton *ToggleToolButtonDelegate::qToggleToolButton() const
{
  return static_cast<QToolButton *>(qObject());
}

// Macro Definition. -----------------------------------------------------------

#define TOGGLE_TOOL_BUTTON_DELEGATE \
    (reinterpret_cast<ToggleToolButtonDelegate *>(delegate))

#endif // TOGGLETOOLBUTTONDELEGATE_H
